$(document).ready(function() {
if ($.browser.msie && parseInt(jQuery.browser.version) == 6) {
    $('#main-menu ul.menu li').hover(function() {
      $(this).addClass('hover');
    }, function() {
      $(this).removeClass('hover');
    });
  }

/*Script for nice look of the skinned block in before(after)-content regions.*/

var summ = 0;
var height = $("#top-content td").height(); //check td height
var td = $("#top-content td").length;	//check how many td elements do we have

for (var $i = 0; $i<td; $i++){

    var $block_lenght = $("#top-content td:eq("+$i+") .block").length;  //check how many blocks do we have in each <td>
	if ($block_lenght == 1){
	    $("#top-content td:eq("+$i+") .block").height($("#top-content td:eq("+$i+")").height()); //If there is only one block => block.height=td.height
	} else {
	    for (var $i_in = 0; $i_in<$block_lenght; $i_in++){
		summ = summ + ($("#top-content td:eq("+$i+") .block:eq("+$i_in+")").height()); //calculate all blocks' height
	    }
	   $("#top-content td:eq("+$i+") .block:last").css({'height': ( $("#top-content td:eq("+$i+") .block:last").height()+(height-summ))}); //last block height = last block height + (td height - all blocks' height)
	   summ = 0;
	}
     
}

summ = 0;
height = $("#after-content td").height();
td = $("#after-content td").length;

for ($i = 0; $i<td; $i++){

    $block_lenght = $("#after-content td:eq("+$i+") .block").length;
	if ($block_lenght == 1){
	    $("#after-content td:eq("+$i+") .block").height($("#after-content td:eq("+$i+")").height());
	} else {
	    for ($i_in = 0; $i_in<$block_lenght; $i_in++){
		summ = summ + ($("#after-content td:eq("+$i+") .block:eq("+$i_in+")").height());
	    }
	   $("#after-content td:eq("+$i+") .block:last").css({'height': ( $("#after-content td:eq("+$i+") .block:last").height()+(height-summ))});
	   summ = 0;
	}

}

});







